from flask import Flask
from flask_apscheduler import APScheduler
from config.SchedulerConfig import SchedulerConfig
from examine import SchedulerTask

app = Flask(__name__)


@app.route('/')
def index():
    return '<h1>Hello World!<h1>'


@app.route('/scheduler/app')
def scheduler():
    SchedulerTask.getAuditOrder()
    return '<h1>Running Su!<h1>'



if __name__ == '__main__':
    # 为实例化的flask引入定时任务配置
    app.config.from_object(SchedulerConfig())
    # 初始化Flask-APScheduler，定时任务
    scheduler = APScheduler()
    scheduler.init_app(app)
    scheduler.start()
    app.run(host='0.0.0.0', port=8081)
